package com.winz.cultureapp.adapter.xrcv;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.mine.xrecyclerview.rcvadapter.BaseRcvAdapter;
import com.mine.xrecyclerview.rcvadapter.ViewHolder;
import com.winz.cultureapp.R;
import com.winz.cultureapp.entity.UserCollectionBean;

import java.util.List;

/**
 * Created by terry on 2018/1/4.
 * 个人收藏 -- 社团
 */

public class CollectionCommunityAdapter extends BaseRcvAdapter<UserCollectionBean.DataBean.ListBean> {
    public CollectionCommunityAdapter(Context context, List<UserCollectionBean.DataBean.ListBean> datas, int... resid) {
        super(context, datas, resid);
    }

    @Override
    public void convert(ViewHolder holder, UserCollectionBean.DataBean.ListBean data, int itemViewType) {
        if (itemViewType != -1){
            holder.setText(R.id.tv_title,data.leagueName)
                    .setText(R.id.tv_content,data.description)
                    .setText(R.id.tv_type,data.categoryName)
                    .setText(R.id.tv_time,"成立时间：" + data.buildDate);



            //圆角处理
            Glide.with(mContext)
                    .load(data.imageUrl)
                    .error(R.drawable.pic_default)
                    .into((ImageView) holder.getView(R.id.iv_pic));
        }
    }


}
